import request from '@/config/axios'

export interface ProjectTaskBookVO {
  id: number
  orderProduceInfoId: number
  dictTaskBookStatus: number
  dictTaskType: number
  projectContractFileName: string
  orderNumber: string
  dictOrderType: number
  customerName: string
  productCode: string
  modelSpecification: string
  unit: string
  orderQuantity: number
  orderDate: Date
  deliveryDate: Date
  dictDeliveryProjectType: number
  dictChangeType: number
  orderVersion: string
  quotation: number
  taxIncludedPrice: number
  priceTaxTotal: number
  taxRate: number
  remarks: string
  orderChangePerson: string
  orderChangeDate: Date
  productName: string
}

// 查询项目任务书列表
export const getProjectTaskBookPage = async (params) => {
  return await request.get({ url: `/order/project-task-book/page`, params })
}

// 查询项目任务书详情
export const getProjectTaskBook = async (id: number) => {
  return await request.get({ url: `/order/project-task-book/get?id=` + id })
}

// 新增项目任务书
export const createProjectTaskBook = async (data: ProjectTaskBookVO) => {
  return await request.post({ url: `/order/project-task-book/create`, data })
}

// 修改项目任务书
export const updateProjectTaskBook = async (data: ProjectTaskBookVO) => {
  return await request.put({ url: `/order/project-task-book/update`, data })
}

// 删除项目任务书
export const deleteProjectTaskBook = async (id: number) => {
  return await request.delete({ url: `/order/project-task-book/delete?id=` + id })
}

// 导出项目任务书 Excel
export const exportProjectTaskBook = async (params) => {
  return await request.download({ url: `/order/project-task-book/export-excel`, params })
}
